﻿using RpcModel;
using RpcModel.Tran.Model;
using RpcSync.Model;
using RpcSync.Model.DB;

namespace RpcSync.DAL
{
    public interface ITransactionDAL
    {
        void AddTran(TransactionListModel add);
        Guid CheckIsRepeat(Guid parentId, string dictate, MsgSource source);
        bool CommitSuccess(Guid tranId);
        Guid[] GetLockOverTimeTran();
        Guid[] GetOverTimeTran();
        Guid[] GetRetryTran();
        TranLog[] GetTranLogs(Guid tranId);
        TransactionDatum GetTransaction(Guid id);
        RegTranState GetTranState(Guid id);
        Guid[] LockStayCommitTran(Guid tranId);
        bool RollbackSuccess(Guid tranId);
        bool RollbackTran(Guid tranId, TransactionStatus status);
        Guid[] RollbackTran(Guid[] tranId);
        bool SetCommitState(TransactionDatum tran);
        bool SetRollbackState(TransactionDatum tran);
        bool SetTranExtend(Guid tranId, string extend);
        bool SubmitTran(Guid tranId);
        Guid[] TranRollbackLock(Guid tranId);
    }
}